<{include file="../common/head.tpl"}>
<link href="/css/uploadify.css" rel="stylesheet">
<script src="/js/datepicker/WdatePicker.js"></script>
<div class="main w1060">
    <div class="pbbg"><a href="/schedule/add">新增员工</a></div>
    <form name="myform" action="<{if $info}>/schedule/doedit<{else}>/schedule/doadd<{/if}>" method="post" id="myform">
        <div class="biaoge">   
    <table width="100%" class="table_form contentWrap">
    <tbody>
    <tr>
        <td width="80">员工编号</td> 
        <td>
            <input type="text" name="staff_identifier" value="<{$info.staff_identifier}>" class="input-text" id="staff_identifier">
        </td>
    </tr>
    <tr>
    <td width="80">头像</td> 
    <td><label>
      <input type="file" name="uploadify" id="uploadify" />
    </label>
        <input type="hidden" name="photo" id="cover" value="<{$info.photo}>">
        <div id="cases_img"><{if $info.photo}><img src="<{$info.photo}>" class="img-responsive"><{/if}></div>
    </td>
    </tr>
    <tr>
        <td width="80">员工姓名</td> 
        <td><input type="text" name="staff_name" value="<{$info.staff_name}>" class="input-text" id="staff_name"></td>
    </tr>

    <tr>
        <td width="80">岗位</td> 
        <td><input type="text" name="station" value="<{$info.station}>" class="input-text" id="station"></td>
    </tr>
    <tr>
        <td width="80">是否临柜</td> 
        <td>
            <input type="checkbox" name="temporary" <{if $info.temporary}>checked="checked"<{/if}> value="1" >是
        </td>
    </tr>
    <tr>
        <td width="80">是否调岗</td> 
        <td>
            <input type="checkbox" name="shift" <{if $info.shift}>checked="checked"<{/if}>  value="1">是
        </td>
    </tr>
    <tr>
        <td width="80">调岗时间</td> 
        <td>
            <input type="text" name="shift_time" value="<{$info.shift_time}>" onClick="WdatePicker()" class="input-text" id="shift_time">
        </td>
    </tr>
    <tr>
        <td width="80">调后岗位</td> 
        <td>
            <input type="text" name="new_station" value="<{$info.new_station}>" class="input-text" id="new_station">
        </td>
    </tr>
    <tr>
        <td width="80">备注</td> 
        <td>
            <textarea name="remark" rows="5" cols="80"></textarea>
        </td>
    </tr>
    </tbody>
    </table>
        </div>
    <div class="bk15"></div>
    <{if $info}><input type="hidden" name="staff_id" value="<{$info.staff_id}>"/><{/if}>
    <input name="dosubmit" type="submit" value="提交" class="button">
    </form>
</div>
<script src="/js/jquery.uploadify.min.js"></script>
<script type="text/javascript">

$(function(){
        $('#uploadify').uploadify({
        //'debug': true,
        'buttonText' : '选择文件',
        'fileObjName' : 'upfile',   
        'swf'      : '/js/uploadify.swf',
        'fileTypeExts' : '*.gif; *.jpg; *.png',
        'uploader' : '/webadmin/attach/do?attach_type=other',
        'onUploadSuccess' : function(file, data, response) {
            var obj = eval('(' + data + ')');
            if (obj.state =='SUCCESS'){
                $('#cover').val(obj.url);
                $('#cases_img').html('<img src="'+obj.url+'" class="img-responsive">');
                alert('上传成功');
            } else {
                alert('上传失败');
            }
        } 
    });
})
</script>
<{include file="../common/footer.tpl"}>